namespace Recorder
{
    public class Game
    {
        int score =0; 
        public int Score()
        {
            return itsscore;
        }
        public void Add(int pins)
        {
            itsThrows[itsCurrentThrow++]=pins;
            itsscore +=pins;
            adjustCurrentFrame();
            }
            private void adjustCurrentFrame()
            {
            if(firstThrow ==true)
            {
                firstThrow =false;
                
            }
            else
            {
                firstThrow =ture;
                itsCurrentFrame++;
            }
            private int itsCurrentFrame =1;
        }
        private int itsCurrentFrame =0;
        private Boolean firstThrow =ture;
        
        public void testSimpleSpace()
        {
            Game g=new Game();   
        }
        public int score()
        {
            return itsScore;
        }
        public void add(int pins)
        {
            itsThrows[itsCurrentThrow++]=pins;
            itsScore +=pins;
        }
        public int ScoreForFrame (int frame)
        {
            int score =0;
            for (int ball =0;
                frame > 0 &&(ball < itsCurrentThrow);
                ball += 2,frame--)
            {
                score += itsThrows[ball]+itsThrows[ball+1];
            }
            return score;
        
        private int itsScore =0;
        private int []itsThrows =new int [21];
        private int itsTurrentThrow =0;
        }
       public int getCurrentFrame()
       {
           return itsCurrentThrow;
       }
    }
}